package com.fw.system.admin.service.impl;

import java.util.List;

import com.fw.common.IdXD;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.fw.system.admin.mapper.TbVipLevelMapper;
import com.fw.system.admin.domain.TbVipLevel;
import com.fw.system.admin.service.ITbVipLevelService;
import com.fw.utils.DateUtils;

/**
 * 会员等级字典Service业务层处理
 * 
 * @author xxx
 * @date 2021-12-03
 */
@Service
public class TbVipLevelServiceImpl extends ServiceImpl<TbVipLevelMapper, TbVipLevel> implements ITbVipLevelService
{
    @Autowired
    private TbVipLevelMapper tbVipLevelMapper;

    @Autowired
    private IdXD idXD;

    /**
     * 查询会员等级字典
     * 
     * @param id 会员等级字典ID
     * @return 会员等级字典
     */
    @Override
    public TbVipLevel selectTbVipLevelById(String id)
    {
        return tbVipLevelMapper.selectTbVipLevelById(id);
    }

    /**
     * 查询会员等级字典列表
     * 
     * @param tbVipLevel 会员等级字典
     * @return 会员等级字典
     */
    @Override
    public List<TbVipLevel> selectTbVipLevelList(TbVipLevel tbVipLevel)
    {
        return tbVipLevelMapper.selectTbVipLevelList(tbVipLevel);
    }

    /**
     * 新增会员等级字典
     * 
     * @param tbVipLevel 会员等级字典
     * @return 结果
     */
    @Override
    public int insertTbVipLevel(TbVipLevel tbVipLevel)
    {
        tbVipLevel.setId(idXD.nextId());
        return tbVipLevelMapper.insertTbVipLevel(tbVipLevel);
    }

    /**
     * 修改会员等级字典
     * 
     * @param tbVipLevel 会员等级字典
     * @return 结果
     */
    @Override
    public int updateTbVipLevel(TbVipLevel tbVipLevel)
    {
        return tbVipLevelMapper.updateTbVipLevel(tbVipLevel);
    }

    /**
     * 批量删除会员等级字典
     * 
     * @param ids 需要删除的会员等级字典ID
     * @return 结果
     */
    @Override
    public int deleteTbVipLevelByIds(String[] ids)
    {
        return tbVipLevelMapper.deleteTbVipLevelByIds(ids);
    }

    /**
     * 删除会员等级字典信息
     * 
     * @param id 会员等级字典ID
     * @return 结果
     */
    @Override
    public int deleteTbVipLevelById(String id)
    {
        return tbVipLevelMapper.deleteTbVipLevelById(id);
    }
}
